package com.ruoyi.housing.service.impl;

import com.ruoyi.housing.domain.DirectionType;
import com.ruoyi.housing.mapper.CentHoustDao;
import com.ruoyi.housing.service.CentHoustService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 小智
 * @PachageName:com.ruoyi.housing.service.impl
 * @ClassName :CentHoustServiceImpl
 * @Description:
 * @date 2021/07/26 11:55
 */
@Service
public class CentHoustServiceImpl implements CentHoustService {

    @Autowired
    CentHoustDao centHoustDao;

    @Override
    public List<Map<String, Object>> JiZhongList() {
        return centHoustDao.JiZhongList();
    }

    @Override
    public List<Map<String, Object>> mapList() {
        return centHoustDao.mapList();
    }

    @Override
    public List<Map<String, Object>> selectList() {
        return centHoustDao.selectList();
    }

    @Override
    public List<Map<String, Object>> SelectCX() {
        List<Map<String,Object>> list = new ArrayList<>();
        for (DirectionType value : DirectionType.values()) {
            Map<String,Object> map = new HashMap<>();
            map.put("id",value.getIndex());
            map.put("name",value.getName());
            list.add(map);
        }
        return list;
    }
}
